home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / var / lib / dpkg / info / linux-sound-base.postinst < prev    next >
Encoding:
Text File  |  2009-04-08  |  2.1 KB  |  76 lines

  1. #!/bin/sh
  2.  
  3. set -e
  4.  
  5. . /usr/share/debconf/confmodule
  6. db_version 2.0
  7.  
  8. case "$1" in
  9. configure|reconfigure)
  10.     if dpkg --compare-versions "$2" lt "1.0.10-4ubuntu2"; then
  11.         # Rename existing symlinks
  12.         if [ -L /etc/modprobe.d/linux-sound-base_noOSS ]; then
  13.             mv /etc/modprobe.d/linux-sound-base_noOSS \
  14.                 /etc/modprobe.d/blacklist-oss.conf
  15.         fi
  16.         if [ -L /etc/modprobe.d/linux-sound-base_noALSA ]; then
  17.             mv /etc/modprobe.d/linux-sound-base_noALSA \
  18.                 /etc/modprobe.d/blacklist-alsa.conf
  19.         fi
  20.  
  21.         # Remove other symlinks and conffiles
  22.         rm -f /etc/hotplug/blacklist.d/linux-sound-base_noOSS
  23.         rm -f /etc/hotplug/blacklist.d/linux-sound-base_noALSA
  24.         rmdir /etc/hotplug/blacklist.d 2>/dev/null || true
  25.         rmdir /etc/hotplug 2>/dev/null || true
  26.  
  27.         rm -f /etc/discover.d/linux-sound-base_noOSS
  28.         rm -f /etc/discover.d/linux-sound-base_noALSA
  29.         rmdir /etc/discover.d 2>/dev/null || true
  30.  
  31.         rm -f /etc/modutils/linux-sound-base_noOSS
  32.         rm -f /etc/modutils/linux-sound-base_noALSA
  33.         rmdir /etc/modutils 2>/dev/null || true
  34.     fi
  35.     if dpkg --compare-versions "$2" lt "1.0.18.dfsg-1ubuntu5"; then
  36.         if [ -L /etc/modprobe.d/blacklist-oss ]; then
  37.             mv /etc/modprobe.d/blacklist-oss \
  38.                /etc/modprobe.d/blacklist-oss.conf
  39.         fi
  40.         if [ -L /etc/modprobe.d/blacklist-alsa ]; then
  41.             mv /etc/modprobe.d/blacklist-alsa \
  42.                /etc/modprobe.d/blacklist-alsa.conf
  43.         fi
  44.     fi
  45.     db_get linux-sound-base/sound_system || :
  46.     case "$RET" in
  47.     OSS)
  48.         rm -f /etc/modprobe.d/blacklist-oss.conf
  49.         rm -f /etc/modprobe.d/blacklist-oss
  50.         rm -f /etc/modprobe.d/linux-sound-base_noOSS
  51.         ln -sf /lib/linux-sound-base/noALSA.modprobe.conf \
  52.             /etc/modprobe.d/blacklist-alsa.conf
  53.         ;;
  54.     ALSA)
  55.         rm -f /etc/modprobe.d/blacklist-alsa.conf
  56.         rm -f /etc/modprobe.d/blacklist-alsa
  57.         rm -f /etc/modprobe.d/linux-sound-base_noALSA
  58.         ln -sf /lib/linux-sound-base/noOSS.modprobe.conf \
  59.             /etc/modprobe.d/blacklist-oss.conf
  60.         ;;
  61.     esac
  62.     ;;
  63. abort-upgrade|abort-remove|abort-deconfigure)
  64.     # We don't have to do anything because we didn't do anything in prerm
  65.     exit 0
  66.     ;;
  67. *)
  68.     echo "postinst called with unknown argument \`$1'" >&2
  69.     exit 1
  70.     ;;
  71. esac
  72.  
  73.  
  74.  
  75. db_stop || :
  76.